package com.jnu.tijian.controller;

import com.jnu.tijian.dto.CalendarRequestDto;
import com.jnu.tijian.dto.ResponseObject;
import com.jnu.tijian.service.CalendarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CalendarController {
    /**
     * 请求对象
     * param: currentYear currentMonth hpId
     *
     * 响应对象
     * 1.对应年份和月份的日历
     * 2.对应挂号规则 剩余挂号量信息
     *      挂号只能挂明天开始30天内的号
      */

    @Autowired
    CalendarService calendarService;

    // api/listCalendar", {hpId:state.hpId, year:state.currentYear, month:state.currentMonth
    @RequestMapping("/listCalendar")
    public ResponseObject listCalendar(@RequestBody CalendarRequestDto calendarRequestDto) {
        return new ResponseObject(ResponseObject.SUCCESS_STATUS, ResponseObject.SUCCESS_DESC,
                calendarService.listAppointmentCalendar(calendarRequestDto));
    }
}
